package com.core.zyyz.enums;

public enum NodeType {
    ORGANIZATION("organization", "组织架构"),
    DEPARTMENT("dept", "机构"),
    EMPLOYEE("employee", "员工");

    private String value;

    private String description;

    public String getValue() {
        return this.value;
    }

    public String getDescription() {
        return this.description;
    }

    NodeType(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public static NodeType getNodeType(String type) {
        for (NodeType nodeType : values()) {
            if (nodeType.is(type))
                return nodeType;
        }
        return null;
    }

    public boolean is(String nodeType) {
        return (nodeType != null && this.value.equals(nodeType));
    }
    }
